package com.aaa.controller;

import com.aaa.entity.Orderdetail;
import com.aaa.service.impl.OrderdetailServiceImpl;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@CrossOrigin
@Controller
@RequestMapping("od")
public class OrderdetailController {
    @Resource
    OrderdetailServiceImpl orderdetailService;
    @RequestMapping("list")
    @ResponseBody
    public List<Orderdetail> list(){
        return orderdetailService.list();
    }
    @RequestMapping("save")
    @ResponseBody
    public Boolean save(Orderdetail orderdetail){
        return orderdetailService.save(orderdetail);
    }
    @RequestMapping("remove")
    @ResponseBody
    public Boolean remove(Integer id){
        return orderdetailService.removeById(id);
    }
    @RequestMapping("update")
    @ResponseBody
    public Boolean update(Orderdetail orderdetail){
        return orderdetailService.updateById(orderdetail);
    }
}
